home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1993 / MacHack 1993.toast / MacHack™ 1987-1992 / MacHack™ '90 / Source Code ƒ / MPW C ƒ / e?grep ƒ / FINDID
Encoding:
Text File  |  1990-04-09  |  1.3 KB  |  40 lines  |  [TEXT/MPS ]

  1. # FindCIdent -- Find C identifier in standard {CIncludes} headers
  2. #
  3. # This script uses John Jeppson's CIncludesCode tool (which comes with
  4. # the CIncludesTool script) to locate the definition of a C identifier
  5. # in previously-indexed headers.  Use "CIncludesTool -m" to index your
  6. # {CIncludes} directory.  Then add a menu item to the Find Menu as:
  7. #
  8. #    AddMenu Find "Find C Identifier/ " 'FindCIdent "`Catenate "{Active}.§"`"'
  9. #
  10. # When you need to look up an identifier, select it and choose the menu
  11. # item (command-space for convenience).  This script will open the
  12. # header where the identifier is declared and highlight the first line
  13. # of its declaration.
  14. #
  15. # CIncludesTool was written by John Jeppson, CIS [76174,2007]
  16. # The source for the tool can be found in MacDev DL8 as CINCLD.SIT
  17. #
  18. # 5.4.90  Matt Holiday, CIS [71320,2400]
  19.  
  20. Set Exit 0
  21.  
  22. CIncludesCode -v "{1}"
  23.  
  24. If "{status}"; Echo "### {0} - invalid identifier {1}"; Exit; End
  25.  
  26. Set x1j "`CIncludesCode -f "{1}"`"
  27.  
  28. If "{x1j}" == ""; Echo "### {0} - unable to locate identifier {1}"; Exit; End
  29.  
  30. ( Evaluate "{x1j}" =~ /∂#include <(?+.h)®1>/ ) ∑ Dev:Null
  31.  
  32. Open "{CIncludes}{®1}" ∑ Dev:Null
  33.  
  34. If "{status}"; Echo "### {0} - unable to open file {®1}"; Exit; End
  35.  
  36. Find • "{Active}"
  37. Find /•≈[¬A-Za-z0-9_]"{1}"[¬A-Za-z0-9_]≈∞/ "{Active}"
  38.  
  39. Set Exit 1
  40.